/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.krossk.dao;

import br.com.krossk.jpa.JPAFactory;
import br.com.krossk.model.Repositorio;
import javax.persistence.EntityManager;

/**
 *
 * @author Henrique
 */
public class RepositorioDAO {

    private static RepositorioDAO instance = new RepositorioDAO();

    public static RepositorioDAO getInstance(){
        return instance;
    }

    public Repositorio getById(int idArquivo){
        EntityManager em = JPAFactory.getEntityManager();
        try{
            return em.find(Repositorio.class, idArquivo);
        }finally{
            em.close();
        }

    }
}
